package net.mimai.vultrue.bus.enums;

import net.mimai.vultrue.framework.utils.JudgeUtils;


/**
 *  通用状态，有特殊状态要求的，需要自行另行定义，不使用此类
 */
public enum BusType {
    INIT(1010,"期初"),

    SALE_ONLINE(1110,"线上销售"),
    SALE_SHOP(1111,"门店销售"),
    SALE_SAME(1112,"同业销售"),
    SALE_ONLINE_R(1130,"线上销售退货"),
    SALE_SHOP_R(1131,"门店销售退货"),
    SALE_SAME_R(1132,"同业销售退货"),

    PURCHASE(2010,"采购"),
    PURCHASE_R(2011,"采购退货"),
    PURCHASE_MNT(2012,"采购维保"),


    STORE_TAKE_LONG(2110,"盘盈"),
    STORE_TAKE_SHORT(2111,"盘亏"),

    STORE_ALLOT(2210,"调拨"),

    RECOVERY_ONLINE(5010,"线上回收"),
    RECOVERY_OFFLINE(5011,"线下回收"),
    RECOVERY_LUXURY(5012,"奢品回收"),
    RECOVERY_CONSIGN_SALE(5013,"寄卖回收"),
    RECOVERY_REDEEM(5014,"回收赎回"),

    CONSIGN_SALE_PROXY(5110,"代销"),//按收手续费方式的寄卖（主要来源于企业）
    CONSIGN_SALE(5112,"寄卖寄卖"),//寄卖（主要来源于个人）
    CONSIGN_SALE_LUXURY(5113,"奢品寄卖"),//寄卖（主要来源于个人）
    CONSIGN_SALE_REDEEM(5114,"寄卖赎回"),

    PAWN_DIS(5210,"绝当"),
    PAWN_DIE(5211,"死当"),
    PAWN_CIVILIAN(5212,"典当民品"),
    PAWN_EXCHANGE(5213,"典当换货"),
    PAWN_REDEEM(5214,"典当赎回"),

    STORE_BORROW_GOODS(2310,"借货"),
    STORE_OTHER_IN_EASY_LOAN(2311,"奢易贷"),
    STORE_OTHER_OUT(2312,"其它出库"),
    STORE_OTHER_COST_CHANGE(2313,"成本变更"),
    STORE_OTHER_IMPORT(2315,"库存导入"),
    OTHER(2399, "其它入库"),
//    STORE_OTHER_C1(2330,"其它鉴定"),
//    STORE_OTHER_C2(2331,"其它质检"),

    MAINTAIN(3010,"维修养护"),


    EASY_LOAN_LUXURY(5310,"奢品奢易贷"),
    EASY_LOAN_CONSIGN(5311,"寄卖奢易贷"),
    EASY_LOAN_REDEEM(5312,"奢易贷赎回"),

    BUYBACK_SAME(5410,"同业回购"),
    BUYBACK_RETAIL(5411,"零售回购"),

    CHECK(6010,"支付对账"),
    CHECK_R(6011,"退款对账"),

    SIGN_IN(7010, "签到"),
    ;
    int key;
    String desc;

    BusType(int key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public int getKey() {
        return key;
    }

    public void setKey(int key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static Boolean isMember(int key){
        BusType[] vs= BusType.values();
        for(BusType h:vs){
            if(JudgeUtils.equals(key,h.getKey())){
                return true;
            }
        }
        return false;
    }

    public static BusType getByKey(int key){
        BusType[] vs= BusType.values();
        for(BusType h:vs){
            if(JudgeUtils.equals(key,h.getKey())){
                return h;
            }
        }
        return null;
    }
}
